<template>
  <div class="login_container">
    <div class="login_box">
      <!-- logo去 -->
      <div class="avatar_box">
        <img src="../assets/logo.jpg" alt="logo" />
        <span>海报设计系统</span>
      </div>
      <!-- 登录表单区域 -->
      <!-- <el-form ref="form" :model="form" :rules="rules" label-width="60px">
        <el-form-item label="账号" prop="account">
          <el-input
            v-model="form.account"
            placeholder="请输入用户名"
          ></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="password">
          <el-input
            v-model="form.password"
            type="password"
            placeholder="请输入密码"
          ></el-input>
        </el-form-item>
        <el-form-item label="">
          <el-button type="primary" class="w100p" @click="login"
            >登录</el-button
          >
        </el-form-item>
        <div class="txt-r">
          <router-link to="/register">没有账号？去注册</router-link>
        </div>
      </el-form> -->
    </div>
  </div>
</template>

<script>
export default {
    name: "login",
    data() {
      return {
        form: {
          account: "",
          password: "",
        },
        rules: {
          account: [
            {
              required: true,
              message: "请输入用户名",
              trigger: ["change", "blur"],
            },
            {
              pattern: /^[a-zA-Z][a-zA-Z0-9_-]{3,31}$/,
              message: "用户名由英文字母开头的长度4-32位字母、_和-组成",
              trigger: ["change", "blur"],
            },
          ],
          password: {
            required: true,
            min: 6,
            message: "请输入至少6个字符的密码",
            trigger: ["change", "blur"],
          },
        },
      };
    }
}
</script>

<style scoped>
.login_container {
  background-image: url("../assets/img.jpg");
  /* 设置图片大小 */
  background-size: 100% 100%;
  /* 设置div高度 */
  height: 100%;
}

.login_box {
  width: 450px;
  height: 400px;
  background-color: white;
  border-radius: 5px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden; /* 隐藏溢出部分 */
}

.avatar_box {
  display: flex; /* 使用 flexbox 布局 */
  align-items: center; /* 垂直居中对齐 */
  justify-content: center; /* 水平居中对齐 */
  height: 100px;
  width: 100%; /*填满父容器宽度 */
  padding: 10px;
  /* box-shadow: 0 0 10px #ddd; */
}

.avatar_box img {
  height: 80px;
  width: 80px;
  border-radius: 50%;
  background-color: #eee;
  margin-right: 5px; /*图片与文字之间的间距 */
}

.avatar_box span {
  font-size: 24px; /* 调整文字大小，根据需要调整 */
  color: #333; /* 调整文字颜色，根据需要调整 */
}
</style>
